package com.yyy.dm.listener.order;

import com.yyy.dm.feign.DMOrderFeign;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@RabbitListener(queues = "order_transaction")
public class OrderListener {

    @Resource
    private DMOrderFeign dmOrderFeign;

    @RabbitHandler
    public void rollbackOrder(Long orderId){
        dmOrderFeign.rollbackOrder(orderId);
    }

}
